/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseWorkReportEntity.cs
*        创建系统时间:       2012/11/2 19:07:04
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseWorkReportEntity
    {
        private string auditStaffID;
        private string categoryFullName;
        private string categoryID;
        private string companyID;
        private string content;
        private string createDate;
        private string createUserID;
        private string departmentID;
        private string description;
        private int enabled;
        private string id;
        private string manHour;
        private string modifyDate;
        private string modifyUserID;
        private string projectFullName;
        private string projectID;
        private int score;
        private string sortCode;
        private string staffFullName;
        private string staffID;
        private string stateCode;
        private string workDate;

        public BaseWorkReportEntity()
        {
            this.id = string.Empty;
            this.companyID = string.Empty;
            this.departmentID = string.Empty;
            this.staffID = string.Empty;
            this.staffFullName = string.Empty;
            this.categoryID = string.Empty;
            this.categoryFullName = string.Empty;
            this.projectID = string.Empty;
            this.projectFullName = string.Empty;
            this.workDate = string.Empty;
            this.content = string.Empty;
            this.manHour = string.Empty;
            this.description = string.Empty;
            this.stateCode = string.Empty;
            this.auditStaffID = string.Empty;
            this.sortCode = string.Empty;
            this.createUserID = string.Empty;
            this.createDate = string.Empty;
            this.modifyUserID = string.Empty;
            this.modifyDate = string.Empty;
        }

        public BaseWorkReportEntity(DataRow dataRow)
        {
            this.id = string.Empty;
            this.companyID = string.Empty;
            this.departmentID = string.Empty;
            this.staffID = string.Empty;
            this.staffFullName = string.Empty;
            this.categoryID = string.Empty;
            this.categoryFullName = string.Empty;
            this.projectID = string.Empty;
            this.projectFullName = string.Empty;
            this.workDate = string.Empty;
            this.content = string.Empty;
            this.manHour = string.Empty;
            this.description = string.Empty;
            this.stateCode = string.Empty;
            this.auditStaffID = string.Empty;
            this.sortCode = string.Empty;
            this.createUserID = string.Empty;
            this.createDate = string.Empty;
            this.modifyUserID = string.Empty;
            this.modifyDate = string.Empty;
            this.GetFrom(dataRow);
        }

        public BaseWorkReportEntity(DataTable dataTable)
        {
            this.id = string.Empty;
            this.companyID = string.Empty;
            this.departmentID = string.Empty;
            this.staffID = string.Empty;
            this.staffFullName = string.Empty;
            this.categoryID = string.Empty;
            this.categoryFullName = string.Empty;
            this.projectID = string.Empty;
            this.projectFullName = string.Empty;
            this.workDate = string.Empty;
            this.content = string.Empty;
            this.manHour = string.Empty;
            this.description = string.Empty;
            this.stateCode = string.Empty;
            this.auditStaffID = string.Empty;
            this.sortCode = string.Empty;
            this.createUserID = string.Empty;
            this.createDate = string.Empty;
            this.modifyUserID = string.Empty;
            this.modifyDate = string.Empty;
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
        }

        public BaseWorkReportEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldID]);
            this.WorkDate = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldWorkDate]);
            this.Content = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldContent]);
            this.ManHour = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldManHour]);
            this.ProjectID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldProjectID]);
            if (dataRow.Table.Columns.Contains(BaseWorkReportTable.FieldProjectFullName))
            {
                this.ProjectFullName = dataRow.IsNull(BaseWorkReportTable.FieldProjectFullName) ? string.Empty : dataRow[BaseWorkReportTable.FieldProjectFullName].ToString();
            }
            this.CategoryID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldCategoryID]);
            if (dataRow.Table.Columns.Contains(BaseWorkReportTable.FieldCategoryFullName))
            {
                this.CategoryFullName = dataRow.IsNull(BaseWorkReportTable.FieldCategoryFullName) ? string.Empty : dataRow[BaseWorkReportTable.FieldCategoryFullName].ToString();
            }
            this.CompanyID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldCompanyID]);
            this.DepartmentID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldDepartmentID]);
            this.Score = BaseBusinessLogic.ConvertToInt(dataRow[BaseWorkReportTable.FieldScore]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldDescription]);
            this.StaffID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldStaffID]);
            if (dataRow.Table.Columns.Contains(BaseWorkReportTable.FieldStaffFullName))
            {
                this.StaffFullName = dataRow.IsNull(BaseWorkReportTable.FieldStaffFullName) ? string.Empty : dataRow[BaseWorkReportTable.FieldStaffFullName].ToString();
            }
            this.AuditStaffID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldAuditStaffID]);
            this.Enabled = BaseBusinessLogic.ConvertToInt(dataRow[BaseWorkReportTable.FieldEnabled]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldSortCode]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldCreateUserID]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldCreateDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldModifyUserID]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseWorkReportTable.FieldModifyDate]);
            return this;
        }

        public BaseWorkReportEntity GetFrom(DataTable dataTable)
        {
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string AuditStaffID
        {
            get
            {
                return this.auditStaffID;
            }
            set
            {
                this.auditStaffID = value;
            }
        }

        public string CategoryFullName
        {
            get
            {
                return this.categoryFullName;
            }
            set
            {
                this.categoryFullName = value;
            }
        }

        public string CategoryID
        {
            get
            {
                return this.categoryID;
            }
            set
            {
                this.categoryID = value;
            }
        }

        public string CompanyID
        {
            get
            {
                return this.companyID;
            }
            set
            {
                this.companyID = value;
            }
        }

        public string Content
        {
            get
            {
                return this.content;
            }
            set
            {
                this.content = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string DepartmentID
        {
            get
            {
                return this.departmentID;
            }
            set
            {
                this.departmentID = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public int Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public string ManHour
        {
            get
            {
                return this.manHour;
            }
            set
            {
                this.manHour = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public string ProjectFullName
        {
            get
            {
                return this.projectFullName;
            }
            set
            {
                this.projectFullName = value;
            }
        }

        public string ProjectID
        {
            get
            {
                return this.projectID;
            }
            set
            {
                this.projectID = value;
            }
        }

        public int Score
        {
            get
            {
                return this.score;
            }
            set
            {
                this.score = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public string StaffFullName
        {
            get
            {
                return this.staffFullName;
            }
            set
            {
                this.staffFullName = value;
            }
        }

        public string StaffID
        {
            get
            {
                return this.staffID;
            }
            set
            {
                this.staffID = value;
            }
        }

        public string StateCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public string WorkDate
        {
            get
            {
                return this.workDate;
            }
            set
            {
                this.workDate = value;
            }
        }
    }
}